<!--
 * @docName: channelAccount.vue
 * @Author: mwl
 * @Date: 14:23
 * @LastEditors: mwl
 * @LastEditTime: 14:23
-->
<template>
  <div>
    <a-tabs default-active-key="1" v-model="activeKey" @change="callback">
      <a-tab-pane key="1" tab="通用账户充值" :disabled="pagetab =='3'">
         <universalAccountDetails :key="timer"></universalAccountDetails>
      </a-tab-pane>
      <a-tab-pane key="2" tab="税费账户充值">
         <taxAccountDetails :key="timer"></taxAccountDetails>
      </a-tab-pane>
    </a-tabs>
  </div>
</template>

<script>
import universalAccountDetails from '@views/myAccount/modules/universalAccountDetails';
import taxAccountDetails from '@views/myAccount/modules/taxAccountDetails';
export default {
  name: 'channelAccount',
  components:{
    universalAccountDetails,
    taxAccountDetails
  },
  data(){
    return{
      activeKey: 1,
      timer: null,
      pagetab : this.$route.query.pagetab
    }
  },
  created() {

  },
  mounted() {
    this.showtabs() //跳转到指定tab
  },
  methods:{
    async callback(key) {
      //
      this.activeKey = key
      //刷新子组件
      this.timer = new Date().getTime()
    },
    showtabs() {
      if (this.pagetab) {
        if(this.pagetab=='3'){
          this.activeKey = '2'
        }else{
          this.activeKey = this.pagetab
        }

      }
    },
  }
}
</script>

<style scoped lang='less'>

</style>
